﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FreeSql.DataAnnotations;
using CommonTools;

namespace shop.Model
{
    /// <summary> 出库明细 </summary>
    public class OutStockItem
    {
        [Column(IsPrimary = true, IsIdentity =true, Position =1)]
        public int Id { get; set; }

        /// <summary> 物流单号 </summary>
        [Column(StringLength = 50, Position =2)]
        public string logistics_no { set; get; }

        /// <summary> 单品支付金额 </summary>
        [Column(Precision =18, Scale =4, Position = 3)]
        public decimal goodsAmount { set; get; }

        /// <summary> 仓库 </summary>
        [Column(StringLength = 100, Position = 4)]
        public string warehouse { set; get; }

        /// <summary> 商家编码 </summary>
        [Column(StringLength = 50, Position = 5)]
        public string spec_no { set; get; }

        /// <summary> 订单编号 </summary>
        [Column(StringLength = 50, Position = 6)]
        public string trade_no { set; get; }

        /// <summary> 原始单号 </summary>
        [Column(StringLength = 300, Position = 7)]
        public string src_tids { set; get; }

        /// <summary> 客服备注 </summary>
        [Column(StringLength = 1024, Position = 8)]
        public string cs_remark { set; get; }

        /// <summary> 子单原始单号 </summary>
        [Column(StringLength = 50, Position = 9)]
        public string src_tid { set; get; }

        /// <summary> 原始子订单号 </summary>
        [Column(StringLength = 50, Position = 10)]
        public string src_oid { set; get; }

        /// <summary> 订单类型 </summary>
        [Column(StringLength = 50, Position = 11)]
        public string trade_type { set; get; }

        /// <summary> 支付账号 </summary>
        [Column(StringLength = 100, Position = 12)]
        public string pay_account { set; get; }

        /// <summary> 出库单编号 </summary>
        [Column(StringLength = 50, Position = 13)]
        public string outstock_no { set; get; }

        /// <summary> 仓库类型 </summary>
        [Column(StringLength = 50, Position = 14)]
        public string warehouse_type { set; get; }

        /// <summary> 打单员 </summary>
        [Column(StringLength = 50, Position = 15)]
        public string printer { set; get; }

        /// <summary> 店铺 </summary>
        [Column(StringLength = 128, Position = 16)]
        public string shop_name { set; get; }

        /// <summary> 出库单状态 </summary>
        [Column(StringLength = 50, Position = 17)]
        public string status { set; get; }

        /// <summary> 出库状态 </summary>
        [Column(StringLength = 50, Position = 18)]
        public string consign_status { set; get; }

        /// <summary> 分拣序号 </summary>
        [Column(Position = 19)]
        public int picklist_seq { set; get; }

        /// <summary> 货品编号 </summary>
        [Column(StringLength = 50, Position = 20)]
        public string goods_no { set; get; }

        /// <summary> 货品名称 </summary>
        [Column(StringLength = 300, Position = 21)]
        public string goods_name { set; get; }


        /// <summary>
        /// 平台货品ID
        /// </summary>
        [Column(StringLength = 50)]
        public string platform_goods_id { set; get; }


        /// <summary> 货品简称 </summary>
        [Column(StringLength = 150, Position = 22)]
        public string goods_shot_name { set; get; }

        /// <summary> 品牌 </summary>
        [Column(StringLength = 100, Position = 23)]
        public string brand_name { set; get; }

        /// <summary> 分类 </summary>
        [Column(StringLength = 50, Position = 24)]
        public string goods_group { set; get; }

        /// <summary> 规格码 </summary>
        [Column(StringLength = 50, Position = 25)]
        public string spec_code { set; get; }

        /// <summary> 规格名称 </summary>
        [Column(StringLength = 300, Position = 26)]
        public string spec_name { set; get; }

        /// <summary> 条形码 </summary>
        [Column(StringLength = 50, Position = 27)]
        public string barcode { set; get; }

        /// <summary> 货品数量 </summary>
        [Column(Precision= 19, Scale =4, Position = 28)]
        public decimal num { set; get; }

        /// <summary> 货品原单价 </summary>
        [Column(Precision = 19, Scale = 4, Position = 29)]
        public decimal goods_original_price { set; get; }

        /// <summary> 货品原总金额 </summary>
        [Column(Precision = 19, Scale = 4, Position = 30)]
        public decimal goods_original_amount { set; get; }

        /// <summary> 订单总优惠 </summary>
        [Column(Precision = 19, Scale = 4, Position = 31)]
        public decimal order_amount { set; get; }

        /// <summary> 邮费 </summary>
        [Column(Precision =18, Scale =4, Position = 32)]
        public decimal post_amount { set; get; }

        /// <summary> 货品成交价 </summary>
        [Column(Precision = 18, Scale = 4, Position = 33)]
        public decimal sell_price { set; get; }

        /// <summary> 货品成交总价 </summary>
        [Column(Precision =18, Scale =4, Position = 34)]
        public decimal sell_amount { set; get; }

        /// <summary> 货品总优惠 </summary>
        [Column(Precision = 18, Scale = 4, Position = 35)]
        public decimal? discount { set; get; }

        /// <summary> 货到付款金额 </summary>
        [Column(Precision = 18, Scale = 4, Position = 36)]
        public decimal? cod_amount { set; get; }

        /// <summary> 货品成本 </summary>
        [Column(Precision = 18, Scale = 4, Position = 37)]
        public decimal? cost_price { set; get; }

        /// <summary> 货品总成本 </summary>
        [Column(Precision = 18, Scale = 4, Position = 38)]
        public decimal? cost_amount { set; get; }

        /// <summary> 订单支付金额 </summary>
        [Column(Precision = 18, Scale = 4, Position = 39)]
        public decimal? paid { set; get; }

        /// <summary> 应收金额 </summary>
        [Column(Precision = 18, Scale = 4, Position = 40)]
        public decimal? receivable { set; get; }

        /// <summary> 退款前支付金额 </summary>
        [Column(Precision = 18, Scale = 4, Position = 41)]
        public string paid_before_return { set; get; }

        /// <summary> 分摊邮费 </summary>
        [Column(Precision = 18, Scale = 4, Position = 42)]
        public decimal? share_post { set; get; }

        /// <summary> 预估邮资 </summary>
        [Column(Precision = 18, Scale = 4, Position = 43)]
        public decimal? calc_post_cost { set; get; }

        /// <summary> 邮资成本 </summary>
        [Column(StringLength = 50, Position = 44)]
        public decimal? post_fee { set; get; }

        /// <summary> 订单包装成本 </summary>
        [Column(Precision = 18, Scale = 4, Position = 45)]
        public decimal? package_cost { set; get; }

        /// <summary> 订单毛利 </summary>
        [Column(Precision = 18, Scale = 4, Position = 46)]
        public decimal? profit { set; get; }

        /// <summary> 毛利率 </summary>
        [Column(Precision = 18, Scale = 4, Position = 47)]
        public decimal? profit_rate { set; get; }

        /// <summary> 客户网名 </summary>
        [Column(StringLength = 100, Position = 48)]
        public string customer_nick_name { set; get; }

        /// <summary> 收件人 </summary>
        [Column(StringLength = 100, Position = 49)]
        public string receiver_name { set; get; }

        /// <summary> 证件号码 </summary>
        [Column(StringLength = 100, Position = 50)]
        public string id_card { set; get; }

        /// <summary> 收货地区 </summary>
        [Column(StringLength = 300, Position = 51)]
        public string receiver_position { set; get; }

        /// <summary> 收货地址 </summary>
        [Column(StringLength = 300, Position = 52)]
        public string receiver_address { set; get; }

        /// <summary> 收件人手机 </summary>
        [Column(StringLength = 100, Position = 53)]
        public string receiver_phone { set; get; }

        /// <summary> 收件人电话 </summary>
        [Column(StringLength = 100, Position = 54)]
        public string receiver_phone2 { set; get; }

        /// <summary> 物流公司 </summary>
        [Column(StringLength = 100, Position = 55)]
        public string logistics_name { set; get; }

        /// <summary> 实际重量 </summary>
        [Column(Precision =18, Scale =4, Position = 56)]
        public decimal? weight { set; get; }

        /// <summary> 预估重量 </summary>
        [Column(Precision =18, Scale =4, Position = 57)]
        public decimal? calc_weight { set; get; }

        /// <summary> 需开发票 </summary>
        [Column(StringLength = 50, Position = 58)]
        public string invoicing_required { set; get; }

        /// <summary> 制单人 </summary>
        [Column(StringLength = 50, Position = 59)]
        public string operator_name { set; get; }

        /// <summary> 拣货员 </summary>
        [Column(StringLength = 50, Position = 60)]
        public string picker_name { set; get; }

        /// <summary> 打包员 </summary>
        [Column(StringLength = 50, Position = 61)]
        public string packager_name { set; get; }

        /// <summary> 检视员 </summary>
        [Column(StringLength = 50, Position = 62)]
        public string checker { set; get; }

        /// <summary> 业务员 </summary>
        [Column(StringLength = 50, Position = 63)]
        public string salesman_name { set; get; }

        /// <summary> 验货员 </summary>
        [Column(StringLength = 50, Position = 64)]
        public string examiner_name { set; get; }

        /// <summary> 打印波次 </summary>
        [Column(StringLength = 50, Position = 65)]
        public string print_no { set; get; }

        /// <summary> 物流单打印状态 </summary>
        [Column(StringLength = 50, Position = 66)]
        public string logistics_print_status { set; get; }

        /// <summary> 发货单打印状态 </summary>
        [Column(StringLength = 50, Position = 67)]
        public string sendbill_print_status { set; get; }

        /// <summary> 分拣单打印状态 </summary>
        [Column(StringLength = 50, Position = 68)]
        public string picklist_print_status { set; get; }

        /// <summary> 分拣单编号 </summary>
        [Column(StringLength = 50, Position = 69)]
        public string picklist_no { set; get; }

        /// <summary> 外部单号 </summary>
        [Column(StringLength = 50, Position = 70)]
        public string outer_no { set; get; }

        /// <summary> 付款时间 </summary>
        [Column(Position = 71)]
        public DateTime? pay_time { set; get; }

        /// <summary> 发货时间 </summary>
        [Column( Position = 72)]
        public DateTime? consign_time { set; get; }

        /// <summary> 赠品方式 </summary>
        [Column(StringLength = 100, Position = 73)]
        public string gift_methods { set; get; }

        /// <summary> 买家留言 </summary>
        [Column(StringLength = 1024, Position = 74)]
        public string buyer_message { set; get; }

        /// <summary> 打印备注 </summary>
        [Column(StringLength = 300, Position = 75)]
        public string print_remark { set; get; }

        /// <summary> 备注 </summary>
        [Column(StringLength = 300, Position = 76)]
        public string remark { set; get; }

        /// <summary> 包装 </summary>
        [Column(StringLength = 50, Position = 77)]
        public string is_package { set; get; }

        /// <summary> 来源组合装编码 </summary>
        [Column(StringLength = 50, Position = 78)]
        public string suite_no { set; get; }

        /// <summary> 拆自组合装 </summary>
        [Column(StringLength = 50, Position = 79)]
        public string self_assembly { set; get; }

        /// <summary> 来源组合装数量 </summary>
        [Column(Precision =18,Scale =4, Position = 80)]
        public decimal from_assembly_qty { set; get; }

        /// <summary> 体积 </summary>
        [Column(Precision =18, Scale =4, Position = 81)]
        public decimal volumetric { set; get; }

        /// <summary> 分销商 </summary>
        [Column(StringLength = 50, Position = 82)]
        public string fenxiao_nick { set; get; }

        /// <summary> 下单时间 </summary>
        [Column(Position = 83)]
        public DateTime? trade_time { set; get; }

        /// <summary> 审核时间 </summary>
        [Column(Position = 84)]
        public DateTime? stock_check_time { set; get; }

        /// <summary> 分销商编号 </summary>
        [Column(StringLength = 50, Position = 85)]
        public string fenxiao_no { set; get; }



        /// <summary> 省份 </summary>
        [Column(StringLength = 50, Position = -1)]
        public string rece_province { set; get; }

        /// <summary> 城市 </summary>
        [Column(StringLength = 50, Position = -2)]
        public string rece_city { set; get; }

        /// <summary> 县区 </summary>
        [Column(StringLength = 50, Position = -3)]
        public string rece_county { set; get; }


        /// <summary> 计算分摊用 </summary>
        [Column(IsIgnore = true)]
        public List<SubFee> FenTan { set;get; }

    }

    public class SubFee
    {
        public string ReportGroup { set; get; }

        public decimal Fee { set; get; }
    }

}
